package framework
{
	import mx.controls.Alert;
	
	public class Message extends Alert
	{
		/**
		 * 设置样式
		 */
		private static function setStyles(p_alert:Alert):void
		{
			p_alert.styleName = "alert";
		}
		
		/**
		 * 弹出信息
		 */
		public static function alert(p_localeKey:String, p_titleKey:String = "msg.tips", 
									 p_flags:uint = 4, p_closeHandler:Function = null):void
		{
			Alert.yesLabel = LangMgr.getResourceByLocaleKey("alert.sure");
			Alert.okLabel = LangMgr.getResourceByLocaleKey("alert.sure");
			Alert.cancelLabel = LangMgr.getResourceByLocaleKey("alert.cancel");
			Alert.noLabel = LangMgr.getResourceByLocaleKey("alert.cancel");
			
			var content:String = LangMgr.getResourceByLocaleKey(p_localeKey);
			var title:String = LangMgr.getResourceByLocaleKey(p_titleKey);
			setStyles(show(content, title, p_flags, null, p_closeHandler));
		}
	}
}